<template>
  <div class="hello">
    <h1>{{ goods }}</h1>
    <a href="javascript:;" class="btn btn&#45;&#45;m" @click="getData()">点我</a>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name: 'HelloWorld',
    data() {
      return {
        msg: 'Hello Marinc',
        goods: null
      }
    },
    methods: {
      getData() {
        axios.get("http://localhost:8095/cors/test").then((res) => {
          let result = res.data;
          console.log(result)
          this.goods = result
        })
      },

    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }
</style>
